unit Form_Main;
//chkb_wsdl
interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, InvokeRegistry, Rio, SOAPHTTPClient, StdCtrls, ToolWin, ComCtrls,
  ExtCtrls,Interface4xzpayService,DateUtils;

type
  TForm1 = class(TForm)
    ToolBar1: TToolBar;
    Button1: TButton;
    Memo_1: TMemo;
    Panel1: TPanel;
    Edit_Unit: TEdit;
    Label1: TLabel;
    Label2: TLabel;
    Edit_KJQJ: TEdit;
    Label3: TLabel;
    Date_Stax: TDateTimePicker;
    Date_Endx: TDateTimePicker;
    Chkb_AddrNull: TCheckBox;
    Chkb_WSDL: TCheckBox;
    Panel2: TPanel;
    Edit_Addr: TEdit;
    Edit_Port: TEdit;
    Label4: TLabel;
    Label5: TLabel;
    procedure Button1Click(Sender: TObject);
    procedure FormShow(Sender: TObject);
  private
  public
    function ExptLink:string;
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
  A:Interface4xzWebService;
  B:WideString;

  UnitLink:string;
  KJNDKJQJ:string;
  StaxTime:string;
  EndxTime:string;
begin
  Memo_1.Lines.Clear;
  Memo_1.Lines.Add(ExptLink);
  try
    //A:=HTTPRIO1 as Interface4xzWebService;
    if Chkb_AddrNull.Checked then
    begin
      A:=GetInterface4xzWebService(Chkb_WSDL.Checked,'',nil);
    end else
    begin
      A:=GetInterface4xzWebService(Chkb_WSDL.Checked,ExptLink,nil);
    end;

    UnitLink:=Trim(Edit_Unit.Text);
    KJNDKJQJ:=Trim(Edit_KJQJ.Text);
    StaxTime:=FormatDateTime('YYYY-MM-DD',Date_Stax.Date);
    EndxTime:=FormatDateTime('YYYY-MM-DD',Date_Endx.Date);
    //B := A.getinfo('010001','2014-01-01','2014-12-28','0');
    B:=A.getinfo(UnitLink,StaxTime,EndxTime,KJNDKJQJ);
    Memo_1.Lines.Add(B);
  except
    on E:Exception do
    begin
      raise Exception.CreateFmt('%S',[E.Message]);
    end;
  end;
end;

function TForm1.ExptLink: string;
var
  Addr:string;
  Port:string;
begin
  Addr:=Trim(Edit_Addr.Text);
  Port:=Trim(Edit_Port.Text);

  Result:='http://%S:%S/systemframe/services/Interface4xzpayService?wsdl';
  Result:=Format(Result,[Addr,Port]);
end;

procedure TForm1.FormShow(Sender: TObject);
begin
  Date_Stax.Date:=StartOfTheMonth(Now);
  Date_Endx.Date:=EndOfTheMonth(Now);
end;

end.
